package test;

/*
public class Student {
    public String name;
    public int age;
    public int sn;
    public String cla;

    public Student(String name, int age, int sn, String cla) {
        this.name = name;
        this.age = age;
        this.sn = sn;
        this.cla = cla;
    }

    public void study() {
        System.out.println(this.name + "学习");
    }

    public void exam() {
        System.out.println(this.name + "考试");
    }

    public void doHomework() {
        System.out.println(this.name + "做作业");
    }
}

class Test {
    public static void main(String[] args) {
        Student s1 = new Student("张三",18,2316,"1班");
        s1.study();
        s1.exam();
        s1.doHomework();

        Student s2 = new Student("李四", 19, 2354, "2班");
        s2.study();
        s2.exam();
        s2.doHomework();
    }
}*/

class Person {
    //姓名
    String name;
    //年龄
    int age;
    //国籍
    //String country;
    static String country;

    public Person(){}

    public Person(String name,int age) {
        this.name = name;
        this.age = age;
    }

    public Person(String name,int age,String country) {
        this.name = name;
        this.age = age;
        this.country = country;
    }

    public void show() {
        System.out.println("姓名："+name+",年龄："+age+",国籍："+country);
    }
}

class PersonDemo {
    public static void main(String[] args) {
        //创建对象1
        Person p1 = new Person("邓丽君",16,"中国");
        p1.show();

        //创建对象2
        Person p2 = new Person("杨幂",22);
        p2.show();

        //创建对象3
        Person p3 = new Person("凤姐",20);
        p3.show();

        p3.country = "美国";
        p3.show();

        p1.show();
        p2.show();
    }
}

